package com.app.buss.mvp.presenter;

import android.content.Context;

import com.app.buss.bean.ChannalBean;
import com.app.buss.bean.ChannelParam;
import com.app.buss.bean.NewsBean;
import com.app.buss.mvp.view.IMainView;
import com.app.buss.utils.DeviceIdUtil;

public class HomePresenter extends BasePresenter<IMainView> {

    public HomePresenter(IMainView view) {
        attachView(view);
    }

    public void getNews(Context context){
        mvpView.showLoading("loading...");
        addSubscription(
                apiStores.getNews(),
                new ApiCallback<NewsBean>() {

                    @Override
                    public void onSuccess(NewsBean model) {
                        mvpView.getDataSuccess(model);
                    }

                    @Override
                    public void onFailure(String msg, int code) {
                        mvpView.getDataFail(msg);
                    }

                    @Override
                    public void onFinish() {
                        mvpView.hideLoading();
                    }
                });
    }
}
